<template>
	<view class="card">
		<view class="main">
			<view class="left">
				<img v-if="userInfo.head" :src="userInfo.head" alt="" srcset="">
				<img v-else src="https://file.casugn.com/storecompcard/temp/general／user@2x(2)_1681184108180.png"
					alt="" srcset="">
			</view>
			<view class="middle">
				<view class="nameWp">
					<text class="name">
						{{userInfo.name?userInfo.name:'请先创建名片'}}
					</text>
					<text class="title">
						{{userInfo.position?userInfo.position:''}}
					</text>
				</view>
				<view class="company">
					{{userInfo.company?userInfo.company:''}}
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		props: {
			userInfo: {
				type: Object,
				required: true,
				default: () => {}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.card {
		width: 750rpx;
		height: 400rpx;
		background-image: url('https://file.casugn.com/storecompcard//7RNiiKJgsPxg6b00e3686eadb1464c7c76a7f888c2f9_1681786910653.png');
		/* 背景图不平铺 */
		background-repeat: no-repeat;
		/* 让背景图基于容器大小伸缩 */
		background-size: 100% 100%;
		position: relative;
		padding-top: 10rpx;

		.main {
			width: 750rpx;
			height: 176rpx;
			display: flex;
			align-items: center;
			position: absolute;
			bottom: 60rpx;

			.left {
				margin: 0 30rpx;
				width: 112rpx;
				height: 112rpx;

				img {
					border-radius: 50%;
					width: 100%;
					height: 100%;
				}
			}

			.middle {
				.nameWp {
					.name {
						height: 50rpx;
						font-size: 36rpx;
						font-weight: 600;
						color: #FFFFFF;
						line-height: 50rpx;
					}

					.title {
						height: 40rpx;
						font-size: 28rpx;
						font-weight: 400;
						color: #C9CDD4;
						line-height: 40rpx;
						margin-left: 32rpx;
					}
				}


				.titleWp {
					margin-top: 25rpx;
					display: flex;
					align-items: center;

					.phone {
						padding: 5rpx 30rpx;
						background: #0048C3;
						border-radius: 15rpx;
						font-size: 20rpx;
						font-weight: 400;
						color: #F9FAFC;
					}
				}

				.company {
					margin-top: 16rpx;
					height: 34rpx;
					font-size: 24rpx;
					font-weight: 400;
					color: #FFFFFF;
					line-height: 34rpx;

				}


			}



		}
	}
</style>